package com.oujia.cloud.cloudcommon.api;

/**
 * Http请求返回统一格式-状态 Util
 *
 * @author yk
 */
public enum APIResultEnum {
    /**
     * 枚举类型
     */

    SUCCESS(1, "成功"),
    FWK_DUPLICATEKEY(-2, "该记录已经存在"),
    VALID_FAIL(-3, "参数验证失败[{0}]"),
    POINT_FNULL(-4, "空指针异常"),


    /**
     * 认证
     */
    ERR_AUTHORIZSTION(10010, "token已经过期"),
    EMPTY_AUTHORIZSTION(10011, "认证参数为空"),
    ROLE_AUTHORIZSTION(10012, "无权访问"),
    ERR_SERVER(10013, "调用服务失败"),
    APPKEY_EMPTY(10014, "APPID错误"),
    SGIN_REE(10015, "验证签名失败"),
    /**
     * 用户管理
     */
    ERR_UNIODID(11002, "获取uniodId错误"),
    TOKEN_UNIODID(11003, "用户toekn解析失败"),
    USER_UN_PHONE(11004, "用户未绑定手机号码"),
    AUTH_SERVICE(11005, "调用认证服务失败"),
    PHONE_CODE_ERR(11006, "验证码已失效"),
    AUTH_APPKEY_APPSECRET(11007, "appKey或者appSecret错误"),
    WX_USER_REGISTER(11008, "此用户手机已绑定其他微信号，请使用手机号重新登录,解绑此前微信"),
    ERR_SING(11009, "错误的sing签名"),
    ERR_APPID(11010, "错误的APPID签名"),
    INVITATION_USER(11011, "你好,用户不能邀请自己"),
    INVITATION_USER_ERR(11012, "用户邀请码错误"),
    INVITATION_USER_READY(11013, "用户已经领取优惠券"),
    WX_BIDING_USER(11014, "请先解绑微信"),
    WX_UNBIDING_USER(11015, "请先绑定微信,才能解绑"),
    USER_ID_ERR(11016, "用户Id错误"),
    USER_INVITATION_UN(11017, "用户未被邀请"),
    USER_INVITATION_CODE(11018, "用户邀请码错误"),
    USER_TOKEN_ERR(11019, "解析用户token错误"),
    TX_UNIONID_USER(11010, "提现微信和登录微信信息不一致，请先登录解绑微信，在绑定当前提现微信"),
    TX_UNIONID_EMPTY(11011, "先绑定微信才能提现"),
    SN_ERR(11012, "SN错误"),
    REFRESH_TOKEN_EMPTY(11013, "刷新token为空"),
    CMSTOKEN_ERR(11014, "cms后台token错误"),
    USER_OPENID_ERR(11015, "用户没有openId"),
    /**
     * 支付管理
     */
    PAY_SIGNERROR(13001, "微信签名错误"),
    PAY_XML_FORMAT_ERROR(13002, "微信xml解析错误"),
    GOODS_ID_ERR(13003, "商品不存在"),
    DIS_ID_ERR(13004, "优惠券已经过期"),
    USERDIS_ID_ERR(13005, "用户关联的优惠券错误"),
    USER_ADDRESS_ID_EMPTY(13007, "用户收货地址为空"),
    ORDER_NO_ERR(13008, "订单编号错误"),
    TRANSACTION_TYPE_ERR(13009, "交易类型"),
    WALL_ETEMPTY_ERR(13010, "没有可以提现的金额"),
    WALL_BALANCE_ERR(13011, "可提现金额大于用户余额"),
    TRANSACTIONAPPLY_ID_ERR(13012, "没有此提现记录"),
    TX_COUNT_ERR(13013, "每个用户每天只能提现一次"),
    ORDER_USER_ERR(13014, "用户没有此订单地址"),
    ORDER_ID_ERR(13015, "订单id错误"),
    TRANSACTIONAPPLY__USER_ID_ERR(13016, "此用户没有这个提现记录"),
    SYNCHRONIZED_STATE(13017, "用户请求过快"),
    /**
     * external 引用的第三方服务
     */
    ORC_IMGESERR(14001, "ORC图片解析失败"),
    BAIDU_TTERR(14002, "百度tts解析失败"),
    BAIDU_TTERRFILE(14004, "百度tts生产本部文件失败"),
    TULING_TTERRFILE(14005, "图灵tts生产本部文件失败"),
    TX_IM_ADDUSER_ERR(14006, "腾讯IM创建用户失败"),
    TX_IM_CREATEGROUP_ERR(14007, "腾讯IM创建群失败"),
    TX_IM_GROUPUSER_ERR(14008, "腾讯Im让用户加入群失败"),
    XINGE_PUSH_ERR(14009, "信鸽推送失败"),
    MSG_ID_ERR(14010, "信息体ID错误"),
    MSG_STATE_ERR(14011, "信息状态没有修改"),
    MSG_STATE_SEND(14012, "已发送消息不能初始化"),
    USER_MESSAGE_LIMIT(14013, "同一手机号，一天最多发送10次验证码"),
    PHONE_NUMBER_ILLEGAL(14014, "手机号格式不对"),
    PHONE_ALI_SEND(14015, "阿里短信初始化异常"),
    PHONE_SEND_ALL(14016, "短信发送异常"),
    MSG_TIME_REPEAT(14017, "该时间段已有消息"),
    MSG_TIME_SEND(14018, "发送中得消息不能编辑"),
    ES_PROPERTIES(14019, "ES聚合失败"),



    /**
     * cms 后台状态码
     */
    ORDER_SUCCESS(15001, "订单已完成不能修改"),
    ORDER_SEND_SUCCESS(15002, "发货完成后才能修改订单"),
    ORDER_SEND_TX(15003, "先发货才能提现"),
    ORDER_FAIL_TX(15004, "退货订单不能提现"),
    ORDER_USER_TX(15005, "用户已经提现了"),
    ORDER_USER_FAILE_ERR(15006, "用户已经提现了，不能退货"),
    ORDER_STATE_ERR(15006, "订单状态不存在"),
    APPLY_STATE_ERR(15006, "申请状态不存在"),
    APPLY_ID_ERR(15007, "申请记录Id不存在"),
    ORDER_STATE_INIT(15008, "初始状态不用修改"),
    ORDER_STATE_FAILS(15009, "订单已经退货了"),
    ORDER_STATE_SUCCESS(15010, "订单已经确认完成不能退货"),
    ORDER_STATE_STATE_FAILES(15011, "订单已退货不能确认完成"),
    WX_XML_FIALS(15012, "微信xml解析失败"),
    WX_TRANSFERS_FIALS(15013, "微信付款失败"),
    WX_TRANSFERS_TX_FIALS(15014, "已提现，不能驳回"),
    JD_ACCESS_TOKEN(15015, "京东访问token过期"),
    JD_REFRESH_TOKEN(15016, "京东刷新token过期"),
    JD_CALL_LIMIT(15017, "调用京东接口次数达到单日最高5000次，已限制"),

    /**
     * 文件上传
     */
    UPLOAD_EMPTY(20001, "上传的文件不能为空"),
    UPLOAD_CREATE_TMP(20002, "创建临时文件异常"),
    UPLOAD_ERROR(20003, "读取文件异常"),
    UPLOAD_EMPTY_LINES(20004, "行读取行列表为空"),
    /**
     *
     */
    UNKOWM_ERROR(-1, "未知错误");


    private Integer code;
    private String msg;

    APIResultEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
